{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "874f8ae1-8c70-4472-abc0-2e183906ddfd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "fa45ae670d6644029bd71c7b3ec16812",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Canvas(height=300, width=1050)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import ipyturtle3 as turtle\n",
    "import math\n",
    "import random\n",
    "from ipyturtle3 import hold_canvas\n",
    "myCanvas=turtle.Canvas(width=1050,height=300)\n",
    "display(myCanvas)\n",
    "myTS=turtle.TurtleScreen(myCanvas)\n",
    "\n",
    "myTS.clear()\n",
    "# myTS.bgcolor(\"lightgreen\")\n",
    "bob=turtle.Turtle(myTS)\n",
    "jess=turtle.Turtle(myTS,isHolonomic=True)\n",
    "jess.shape(\"circle\")\n",
    "bob.shape(\"turtle\")\n",
    "colors = ['red','purple', 'blue', 'green']\n",
    "\n",
    "myTS.delay(0)\n",
    "jess.penup()\n",
    "jess.goto(-500,75)\n",
    "jess.pendown()\n",
    "jess.color(\"red\")\n",
    "bob.penup()\n",
    "bob.goto(-500,-75)\n",
    "bob.pendown()\n",
    "bob.color(\"green\")\n",
    "\n",
    "myTS.delay(200)\n",
    "j=0\n",
    "b=0\n",
    "jess.width(3)\n",
    "bob.width(3)\n",
    "for i in range(100):\n",
    "    if j <= b-50:\n",
    "        v=random.randint(50,100)\n",
    "        jess.pencolor(colors[i%4])\n",
    "        jess.forward(v)\n",
    "        j+=v\n",
    "    bob.pencolor(colors[i%4])\n",
    "    bob.forward(10)\n",
    "    b+=10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ecb12008-a4d7-4b4c-aa98-91f4fe4d3997",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "dfb53ebb-64c0-4479-97c1-1be84618d6e1",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
